<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Widget Store</title>


<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/widget.css" />
<link type="text/css" href="css/cupertino/jquery-ui-1.10.0.custom.min.css" rel="stylesheet" />	

<script src="js/lang/en.js" type="text/javascript"></script>
<script src="js/lang/pt.js" type="text/javascript"></script>

<script src="js/libs/modernizr-2.0.6.min.js"></script>

<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.0.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.raty.min.js"></script>

<script type="text/javascript" src="js/cookies.js"></script>
<script type="text/javascript" src="js/signals.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<script type="text/javascript" src="js/store.js"></script>
<script type="text/javascript" src="js/pmrpc.js"></script>




<script type="text/javascript">

	function IndexPageBuilder () {
		IndexPageBuilder.prototype = new PageBuilder();
	}
	
	IndexPageBuilder.prototype.build = function () {
		$("#selectFavourites").html(getDisplayString("select_favourites"));
		$("#selectFeatured").html(getDisplayString("select_featured"));
		$("#selectMostRecent").html(getDisplayString("select_most_recent"));
		$("#selectAll").html(getDisplayString("select_all"));			
	}
	
	
	$(document).ready(function() {
		firstLogin ( );
		buildPage ( new IndexPageBuilder() );
		
		$("#searchText").on('keydown', function(e) {
			if ( e.which == 13 ) {
				e.preventDefault();
				searchStore();
			}
		});
		 //$("#widget_view").hide();
		var q = getQueryVariable("q");
		if ( q == null ) {
			getFeaturedWidgets();
		}
		else {
			searchStoreWidgets ( q );
		}
	});
	
	
	function searchStoreLocal ( ) {
		searchStoreWidgets ( $("#searchText").val());
	}


</script>
</head>
<body>






<!-- <link rel="stylesheet" type="text/css" href="css/scrollable-horizontal.css" />
<link rel="stylesheet" type="text/css" href="css/scrollable-buttons.css" />
<link rel="stylesheet" type="text/css" href="css/scrollable-navigator.css"/>
 -->
 
<div id="page">

<div class="headerMain">
    <div class="navigationBar">
    	<div class="navigationItemSelected" id="store_link">Widget Store</div>
        <div class="navigationItem" onClick="goToCategorySearch()" id="categories_link">Categories</div>
        <div class="navigationItem" onClick="goToFavourites()" id="favourites_link">Favourites</div>
        <div class="logged-in"><div class="navigationItem" onClick="goToMyWidgets()" id="my_widgets_link">My Widgets</div></div>
        <div class="logged-in"><div class="navigationItem" onClick="goToWidgetCreator()" id="creator_link">Creator</div></div>
        <div class="admin-view"><div class="navigationItem" onClick="goToAdmin()" id="admin_link">Admin</div></div>
        <div class="searchtag" onclick="searchStore();">Search</div>
        <input class="searchBox" type="text" name="q" placeholder="Search term here" id="searchText" />
        <div class="login" id="login"></div>
       <div class="clear"></div>
    </div>
    <div class="clear"> </div>
</div>
<div class="clear"> </div>


<!--<nav class="main_nav">


<div class="tab_container">
    <div id="catNav" class="tab_content_nav">
        <ol class="nav">
        insert categories here tags
        	<li><a href="#" onclick="showFavourites()">My Favourites</a></li>
        	<li><a href="#" onclick="getFeaturedWidgets()">Featured Widgets</a></li>
            <li><a href="#" onclick="searchStoreWidgetsOrderby('*:*', 'date')">Most Recent</a></li>
            <li><a href="#" onclick="searchStoreWidgets( '*:*')">All Widgets</a></li>
        </ol>
    </div>

</div>

</nav>-->



<div class="apps">

 <div class="sectionhead">
          	<span class="logged-in"><span class="widgetFilterItemSelected" id="selectFavourites" onclick="getMyFavourites()">My Favourites</span></span>
        	<span class="widgetFilterItem" onclick="getFeaturedWidgets()" id="selectFeatured">Featured Widgets</span>
            <span class="widgetFilterItem" onclick="searchStoreWidgetsOrderby('*:*', 'date')" id="selectMostRecent">Most Recent</span>
            <span class="widgetFilterItem" onclick="searchStoreWidgets( '*:*')" id="selectAll">All Widgets</span>
 </div>

 <div class="section" id="widget_list">
  <!-- <div class="scrollable" id="browsable">
   <div id="items" class="items">
   </div>
  </div>
  <div class="navi"></div> -->
  <div id="items" class="widget_list">
  		<!--<div class="widgetPlacardBox">
            <div class="widgetIcon"><img src="images/icon.png" width="80" height="80"/></div>
            <div class="widgetTitle">A Long Widget Name</div>
            <div class="widgetCategory">Creativity</div>
            <div class="widgetRating"><span id="r1"></span>(2)</div>
		</div>
  		<div class="widgetPlacardBox">
            <div class="widgetIcon"><img src="images/icon.png" width="80" height="80"/></div>
            <div class="widgetTitle">Widget</div>
            <div class="widgetCategory">Problem Solving</div>
            <div class="widgetRating"><span id="r2"></span>(40)</div>
        </div>
   		<div class="widgetPlacardBox">
            <div class="widgetIcon"><img src="images/icon.png" width="80" height="80"/></div>
            <div class="widgetTitle">Widget3</div>
            <div class="widgetCategory">Communication</div>
            <div class="widgetRating"><span id="r3"></span>(19)</div>
        </div>
  		<div class="widgetPlacardBox">
            <div class="widgetIcon"><img src="images/icon.png" width="80" height="80"/></div>
            <div class="widgetTitle">Widget4</div>
            <div class="widgetCategory">Collaboration</div>
            <div class="widgetRating"><span id="r4"></span>(6)</div>
        </div>-->
 </div>

  <div class="clear"> </div>  
 </div>
</div>

<div class="clear"> </div>


<footer>
 
</footer>
</div> <!-- page -->
 


</body></html>